'use strict'

const readline = require("readline")
const fs = require("fs")
const AppHotel = require("./classes/AppHotel")

const rl = readline.createInterface({
    input: fs.createReadStream(process.argv[2])
})

rl.on("line", estadia => {
    const app = new AppHotel()
    app.cadastrarHoteis()
    const orcamentos = app.gerarOrcamentos(app.getHoteis(), estadia)
    app.setOrcamentos(orcamentos)
    const hotel = app.buscarHotelMenorPreco(app.getOrcamentos())
    console.log(hotel.nome)
})